package com.ch.ms.data.domain.character;

import com.alibaba.fastjson.annotation.JSONField;
import com.ch.ms.data.domain.AbstractMaplePersistable;
import com.ch.ms.data.domain.account.ChmsAccount;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "chms_character", schema = "chms_new")
@DynamicInsert
@DynamicUpdate
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ChmsCharacter extends AbstractMaplePersistable<Integer> {
    private static final long serialVersionUID = -520342048096703267L;
    private String name;
    private Short level;
    private Long experience;

    @JSONField(serialize = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private ChmsAccount account;
}
